<template>
    <div class="logo-container">
        <SvgIcon name="game-controller" width="32px" height="32px"></SvgIcon>
        <div class="ms-2">运营辅助</div>
    </div>
    <el-menu
        default-active="/dashboard"
        active-text-color="#0d6efd"
        background-color="#334154"
        text-color="#f8f9fa"
        class="el-menu-vertical-demo"
        :collapse="isCollapse"
        @open="handleOpen"
        @close="handleClose"
        router
    >
        <el-menu-item index="/dashboard">
            <el-icon><Monitor /></el-icon>
            <span>首页</span>
        </el-menu-item>
        <el-sub-menu index="2">
            <template #title>
                <el-icon><location /></el-icon>
                <span>系统管理</span>
            </template>
            <el-menu-item index="1-4-1">
                <el-icon><User /></el-icon>
                <span>用户管理</span>
            </el-menu-item>
        </el-sub-menu>
    </el-menu>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { Location, Monitor, User } from '@element-plus/icons-vue'

const isCollapse = ref(false)
const handleOpen = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
</script>
<style scoped lang="scss">
.el-menu-vertical-demo:not(.el-menu--collapse) {
    width: 200px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 60px;
    color: #f8f9fa;
    cursor: pointer;
    background-color: #334154;
}
</style>
